home *** CD-ROM | disk | FTP | other *** search
- '╔═══════════════════════════════════════════════════════════════════╗
- '║ EZMOUSE DEMO ║
- '║ Written by FRED SEXTON Jr. ║
- '║ Hereby released to public domain ║
- '╠═══════════════════════════════════════════════════════════════════╣
- '║ The COMMON SHARED variables are required for these routines. ║
- '║ The order of the COMMON SHARED variables MUST BE EXACTLY AS SHOWN.║
- '╠═══════════════════════════════════════════════════════════════════╣
- '║ lft = left mouse button status ║
- '║ 0 = left button is not pressed ║
- '║ 1 = left button is pressed ║
- '║ lftcc = left mouse button click count ║
- '║ if this value = 2 then a double click occurred ║
- '║ rgt = right mouse button status ║
- '║ 0 = right button is not pressed ║
- '║ 1 = right button is pressed ║
- '║ rgtcc = right mouse button click count ║
- '║ if this value = 2 then a double click occurred ║
- '║ mx = mouse pointer x axis location ║
- '║ my = mouse pointer y axis location ║
- '╚═══════════════════════════════════════════════════════════════════╝
- DEFINT A-Z
- '$DYNAMIC
- COMMON SHARED lft, lftcc, rgt, rgtcc, mx, my 'set up the variables
-
- SCREEN 7 'set graphics mode
- 'in this mode mx will be
- '0-638 so divide by 2
- 'for screen coordinate
-
- CALL mreset(found) 'check for mouse
- IF found <> 1 THEN END 'and reset it's defaults
-
- CALL hookmouse(lft) 'hook variables to mouse
-
- LINE (0, 0)-(319, 199), 4, BF
- LINE (10, 10)-(309, 189), 14, B 'setup screen for demo
- LINE (11, 11)-(308, 188), 1, BF
-
- minx = 22: maxx = 616 'multiply x-coordinates by 2
- miny = 11: maxy = 188
- CALL msetlim(minx, maxx, miny, maxy) 'set min/max mouse values
-
- COLOR 15, 4
- LOCATE 25, 13
- PRINT "<ESC> TO EXIT";
- LOCATE 1, 1
- PRINT "X= Y="
-
- CALL mcuron 'turn on mouse cursor
-
- DO
- LOCATE 1, 3
- PRINT USING "###"; mx \ 2
- LOCATE 1, 10
- PRINT USING "###"; my
- LOCATE 1, 14
- IF lft THEN
- PRINT "LEFT";
- IF lftcc > 1 THEN PRINT " DOUBLE"; ELSE PRINT " ";
- ELSE
- PRINT " "
- END IF
- LOCATE 1, 26
- IF rgt THEN
- PRINT "RIGHT";
- IF rgtcc > 1 THEN PRINT " DOUBLE"; ELSE PRINT " ";
- ELSE
- PRINT " "
- END IF
- LOOP WHILE INKEY$ <> CHR$(27)
-
- CALL mcuroff 'turn off mouse cursor
-
- CALL unhookmouse 'MUST UNHOOK MOUSE
-
- END
-
-